<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>登录页面</title>
		<link rel="stylesheet" type="text/css" href="fonts/iconfont.css" />
		<script src="js/rem.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="css/base.css" />
		<link rel="stylesheet" type="text/css" href="css/login.css" />
	</head>
	<body>
		<div class="container">
			<!-- header -->
			<header>
				<a href="index-rec.html" class="backBtn"><span class="iconfont icon-left"></span></a>
				<span class="s1">登录</span>
				<span></span>
			</header>

			<!-- main -->
			<main>
				<div class="main1">
					<img src="images/logo.jpg">
				</div>
				<div class="con">
					<div class="c">
						<span>+86</span>
						<span class="iconfont icon-triangle-copy-copy-copy
							">:</span>

					</div>
					<form class="f1" action="" method="">
						<input class="ipt" type="text" name="" id="" value="(请输入手机号)" />

					</form>
				</div>


				<div class="con">
					<div class="c">
						<span>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码:</span>
					</div>
					<form class="f2" action="" method="">
						<input class="ipt2" type="text" name="" id="" value="&nbsp;(请输入密码)" />


						<!-- <button type="button" class="ss">获取短信验证码</button> -->
					</form>
				</div>


				<div class="main2">
					<a href="register.html">立即注册</a>
					<a href="">找回密码</a>
				</div>
				<div class="main3">
					<button type="button" class="loginbtn"> 登录</button>
				</div>
				<div class="main4">
					<span class="s1"></span>
					<span class="s2">或</span>
					<span class="s3"></span>
				</div>

				<div class="main5">
					<a href="">
						<span class="iconfont icon-weixin"></span>
					</a>
					<a href="chatlogin.html">&nbsp;&nbsp;微信授权登录</a>
				</div>
			</main>

			<script src="js/reg.js" type="text/javascript" charset="utf-8"></script>
			<script src="js/axios.min.js" type="text/javascript" charset="utf-8"></script>

			<script type="text/javascript">
				let ipt1 = document.querySelector(".ipt")
				let ipt3 = document.querySelector(".ipt2");
				let loginBtn = document.querySelector(".loginbtn")
				let loginApi = "http://15637237221.wicp.vip/yh//mine/login.do";
				let backBtn=document.querySelector('.backBtn')

				loginBtn.onclick = function() {
						let loginCount = ipt1.value;
						let password = ipt3.value;
						axios.post(loginApi, {
								loginCount,
								password

							})
							.then(res => {

								console.log(res.data)
								if (res.data.code == 0) {
									localStorage.setItem("token", res.data.info);
									location.href = 'index-rec.html'
								} else {
									alert(res.data.msg)
								}

							}).catch(error => {
								console.log(error)
							})
				}
				
				
				
			</script>

		</div>
	</body>
</html>
